home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Communication / NewsBase / Source / common.subproj / IHelp.m < prev    next >
Text File  |  1993-01-12  |  2KB  |  77 lines

  1. /*$Copyright:
  2.  * Copyright (C) 1992.5.22. Recruit Co.,Ltd. 
  3.  * Institute for Supercomputing Research
  4.  * All rights reserved.
  5.  * NewsBase  by ISR, Kazuto MIYAI, Gary ARAKAKI, Katsunori SUZUKI, Kok-meng Lue
  6.  *
  7.  * You may freely copy, distribute and reuse the code in this program under 
  8.  * following conditions.
  9.  * - to include this notice in the source code, if it is to be distributed 
  10.  *   with source code.
  11.  * - to add the file named "COPYING" within the code, which shall include 
  12.  *   GNU GENERAL PUBLIC LICENSE(*).
  13.  * - to display an acknowledgement in binary code as follows: "This product
  14.  *   includes software developed by Recruit Co.,Ltd., ISR."
  15.  * - to display a notice which shall state that the users may freely copy,
  16.  *   distribute and reuse the code in this program under GNU GENERAL PUBLIC
  17.  *   LICENSE(*)
  18.  * - to indicate the way to access the copy of GNU GENERAL PUBLIC LICENSE(*)
  19.  *
  20.  *   (*)GNU GENERAL PUBLIC LICENSE is stored in the file named COPYING
  21.  * 
  22.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  23.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  24.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  25. $*/
  26.  
  27. #import <appkit/appkit.h>
  28. #import <defaults/defaults.h>
  29. #import <streams/streams.h>
  30. #import <string.h>
  31.  
  32. #import "IHelp.h"
  33. #import "Localization.h"
  34.  
  35. @implementation IHelp
  36.  
  37. - init
  38. {
  39.     [super init];
  40.     LoadLocalNib("Help.nib",self,NO,[self zone]);
  41.     return self;
  42. }
  43.  
  44. - openHelpPanel:sender
  45. {
  46.     [oHelpPanel makeKeyAndOrderFront:self];
  47.     return self;
  48. }
  49.  
  50. - setOHelpScrollView:anObject
  51. {
  52.     oHelpScrollView = anObject;
  53.     [self loadTextFile:"Help.doc"];
  54.     return self;
  55. }
  56.  
  57. - loadFile:sender
  58. {
  59.     [self loadTextFile:[[sender selectedCell] title]];
  60.     return self;
  61. }
  62.  
  63. - loadTextFile:(const char *)file
  64. {
  65.     id        textObj;
  66.     NXStream    *fileStream;
  67.  
  68.     if ((fileStream = LocalMapFile(file, NX_READONLY)) != NULL) {
  69.     textObj = [oHelpScrollView docView];
  70.     [textObj readRichText:fileStream];
  71.     NXCloseMemory(fileStream, NX_FREEBUFFER);
  72.     }
  73.     return self;
  74. }
  75.  
  76. @end
  77.